package com.yincai.carefreewater.callback;

import org.json.JSONException;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by $zhangke on 2017/5/16.
 *
 *
 */


//泛型T： 代表可以返回给主线程 什么类型的javaBean，比如是person 还是animal
public abstract class StringCallback<T> {
    public StringCallback(){

    }
    public abstract void onBeforeRequest(Request request);
    public abstract void onFailure(Call call, IOException e);
    public abstract void onSuccess(Response response, String t) throws JSONException;
    public abstract void onError(Response response,String errorMsg);
}
